package com.yanggu.mapreduce.keyvalueinputformat;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * @version V1.0
 * @author: YangGu
 * @date: 2019/12/15 10:59
 * @description:
 */
public class KeyValueInputFormatMapper extends Mapper<Text, Text, Text, LongWritable> {

    private LongWritable v = new LongWritable(1);


    @Override
    protected void map(Text key, Text value, Context context) throws IOException, InterruptedException {
        context.write(key, v);
    }
}
